<template>
  <div>
      <el-table :data="memberlist" border style="width: 100%">
          <el-table-column prop="uid" label="用户编号" width="180">
          </el-table-column>
          <el-table-column prop="nickname" label="昵称" width="180">
          </el-table-column>
          <el-table-column prop="phone" label="手机号">
          </el-table-column>
          <el-table-column label="状态">
            <template slot-scope="item">
                    <div>
                        <el-button v-if="item.row.status == 1" type="primary" size="small">启用</el-button>
                        <el-button v-else type="danger" size="small">禁用</el-button>
                    </div>
                </template>
          </el-table-column>
          <el-table-column label="操作">
              <template slot-scope="item">
                  <div>
                      <el-button type="primary" icon="el-icon-edit" size="small" @click="edit(item.row.uid)">编辑</el-button>
                  </div>
              </template>
          </el-table-column>
      </el-table>
  </div>
</template>
<script>
import {mapGetters,mapActions} from 'vuex'
export default {
  data() {
      return {
  
      }
  },
  methods: {
      ...mapActions({
          getMember:'member/getMemberListAction'
      }),
      edit(uid){
        this.$emit('edit',uid)
      }

  },
  mounted() {
      this.getMember()
   },
  watch: {},
  computed: {
      ...mapGetters({
          memberlist:'member/getMemberList'
      })
  },
  filters: {},
  components: {
  }
}
</script>
<style scoped>
.top {
  margin: 15px;
}
</style>